package org.frame.factory;

import org.frame.myaop.ChainManager;

import java.lang.reflect.InvocationHandler;

public class ProxyFactory implements IProxyFactory {
    public static Object getProxyObject(Class clazz,IAddFeature addFeature){
        Object ret = null;
        InvocationHandler handler = JdkDynamicProxyHandler.getHandler(clazz, addFeature);//get handler
        ret = JdkDynamicProxyHandler.getProxyObject(handler,clazz);
        return ret;
    }
    public static  Object getProxyObject(ChainManager cm){

        Object ret = null;
        ret = JdkDynamicProxyHandler.getProxyObject(JdkDynamicProxyHandler.getHandler(cm),cm.getTarget());
        return ret;
    }


}
